function Dnew = save_raw_tra_to_D(Draw,Dnew)

if nargin == 0;
    Draw = spm_eeg_load;
    Dnew=Draw;
elseif nargin == 1;
    Dnew=Draw;
end

if ischar(Dnew); Dnew = spm_eeg_load(Dnew); end
if ischar(Draw); Draw = spm_eeg_load(Draw); end

grad=Draw.sensors('MEG');
raw_tra = grad.tra;

if ~isfield(Dnew,'raw_tra_matrix');
   Dnew.raw_tra_matrix = raw_tra;
else
    disp('Dnew SPM object already has raw_tra_matrix saved. Using this matrix rather than overwriting.');
end

if ~isfield(Dnew,'raw_sensors');
   Dnew.raw_sensors = grad;
else
    disp('Dnew SPM object already has raw_sensors saved. Using this matrix rather than overwriting.');
end


Dnew.save;
end
